<%@include file="taglib_includes.jsp" %>
<c:import url="header.jsp" />
<script type="text/javascript" src="js/contacts.js"></script>
<fmt:setLocale value="nl_NL" />
		<input type="button" value="Voeg een nieuw product toe" onclick="javascript:go('saveProduct.htm');"/>
	<br/>
	<form action="zoekProducten.htm" method="post">		
			<table>
			<tr>
				<td>Zoek een product:</td> 
				<td><input type="text" name="naam"/>
					&nbsp;&nbsp;<input type="submit" value="Zoek"/>
					&nbsp;&nbsp;<input type="button" value="Voeg een nieuw product toe" onclick="javascript:go('saveProduct.htm');"/>
			</td></tr>
		</table>
	</form>
	
	<br/>
	<table style="border-collapse: collapse;" border="1" bordercolor="#fff" width="900">
		<br/>
		<tr bgcolor="green">
			<th>Naam</th>			
			<th>Omschrijving</th>	
			<th>Prijs</th>
			<th>Categorie</th>
			<th>Merk</th>
			<th></th>
			<th></th>
		</tr>
		<c:if test="${! empty alleProducten}">
			<c:forEach var="product" items="${alleProducten}">		
		    <tr>
				<td><c:out value="${product.naam}"></c:out></td>
				<td><c:out value="${product.omschrijving}"></c:out> </td>
				<td><c:out value="${product.prijs}"></c:out></td>
				<td><c:out value="${product.categorie}"></c:out></td>
				<td><c:out value="${product.merk}"></c:out></td>
				<td>&nbsp;<a href="updateProduct.htm?id=${product.productId}">Wijzigen</a></td>
				<td>&nbsp;&nbsp;<a href="javascript:deleteProduct('deleteProduct.htm?id=${product.productId}');">Verwijderen</a></td>
			</tr>
			</c:forEach>
		</c:if>				
	</table>	
	</center>
		
<c:import url="footer.jsp" />